Optimal. Leaf size=140 \[ \frac {b \left (a^2 d+2 a b c-b^2 d\right ) \tan (e+f x)}{f}-\frac {\left (a^3 d+3 a^2 b c-3 a b^2 d-b^3 c\right ) \log (\cos (e+f x))}{f}+x \left (a^3 c-3 a^2 b d-3 a b^2 c+b^3 d\right )+\frac {(a d+b c) (a+b \tan (e+f x))^2}{2 f}+\frac {d (a+b \tan (e+f x))^3}{3 f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.16, antiderivative size = 140, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {3528, 3525, 3475} \[ \frac {b \left (a^2 d+2 a b c-b^2 d\right ) \tan (e+f x)}{f}-\frac {\left (3 a^2 b c+a^3 d-3 a b^2 d-b^3 c\right ) \log (\cos (e+f x))}{f}+x \left (-3 a^2 b d+a^3 c-3 a b^2 c+b^3 d\right )+\frac {(a d+b c) (a+b \tan (e+f x))^2}{2 f}+\frac {d (a+b \tan (e+f x))^3}{3 f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3475
Rule 3525
Rule 3528
Rubi steps
\begin {align*} \int (a+b \tan (e+f x))^3 (c+d \tan (e+f x)) \, dx &=\frac {d (a+b \tan (e+f x))^3}{3 f}+\int (a+b \tan (e+f x))^2 (a c-b d+(b c+a d) \tan (e+f x)) \, dx\\ &=\frac {(b c+a d) (a+b \tan (e+f x))^2}{2 f}+\frac {d (a+b \tan (e+f x))^3}{3 f}+\int (a+b \tan (e+f x)) \left (a^2 c-b^2 c-2 a b d+\left (2 a b c+a^2 d-b^2 d\right ) \tan (e+f x)\right ) \, dx\\ &=\left (a^3 c-3 a b^2 c-3 a^2 b d+b^3 d\right ) x+\frac {b \left (2 a b c+a^2 d-b^2 d\right ) \tan (e+f x)}{f}+\frac {(b c+a d) (a+b \tan (e+f x))^2}{2 f}+\frac {d (a+b \tan (e+f x))^3}{3 f}+\left (3 a^2 b c-b^3 c+a^3 d-3 a b^2 d\right ) \int \tan (e+f x) \, dx\\ &=\left (a^3 c-3 a b^2 c-3 a^2 b d+b^3 d\right ) x-\frac {\left (3 a^2 b c-b^3 c+a^3 d-3 a b^2 d\right ) \log (\cos (e+f x))}{f}+\frac {b \left (2 a b c+a^2 d-b^2 d\right ) \tan (e+f x)}{f}+\frac {(b c+a d) (a+b \tan (e+f x))^2}{2 f}+\frac {d (a+b \tan (e+f x))^3}{3 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] time = 1.08, size = 130, normalized size = 0.93 \[ \frac {6 b \left (3 a^2 d+3 a b c-b^2 d\right ) \tan (e+f x)+3 b^2 (3 a d+b c) \tan ^2(e+f x)+3 (a-i b)^3 (d+i c) \log (\tan (e+f x)+i)+3 (a+i b)^3 (d-i c) \log (-\tan (e+f x)+i)+2 b^3 d \tan ^3(e+f x)}{6 f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.43, size = 147, normalized size = 1.05 \[ \frac {2 \, b^{3} d \tan \left (f x + e\right )^{3} + 6 \, {\left ({\left (a^{3} - 3 \, a b^{2}\right )} c - {\left (3 \, a^{2} b - b^{3}\right )} d\right )} f x + 3 \, {\left (b^{3} c + 3 \, a b^{2} d\right )} \tan \left (f x + e\right )^{2} - 3 \, {\left ({\left (3 \, a^{2} b - b^{3}\right )} c + {\left (a^{3} - 3 \, a b^{2}\right )} d\right )} \log \left (\frac {1}{\tan \left (f x + e\right )^{2} + 1}\right ) + 6 \, {\left (3 \, a b^{2} c + {\left (3 \, a^{2} b - b^{3}\right )} d\right )} \tan \left (f x + e\right )}{6 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 2.72, size = 2046, normalized size = 14.61 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.02, size = 247, normalized size = 1.76 \[ \frac {b^{3} d \left (\tan ^{3}\left (f x +e \right )\right )}{3 f}+\frac {3 \left (\tan ^{2}\left (f x +e \right )\right ) a \,b^{2} d}{2 f}+\frac {\left (\tan ^{2}\left (f x +e \right )\right ) b^{3} c}{2 f}+\frac {3 a^{2} b d \tan \left (f x +e \right )}{f}+\frac {3 a \,b^{2} c \tan \left (f x +e \right )}{f}-\frac {b^{3} d \tan \left (f x +e \right )}{f}+\frac {\ln \left (1+\tan ^{2}\left (f x +e \right )\right ) a^{3} d}{2 f}+\frac {3 \ln \left (1+\tan ^{2}\left (f x +e \right )\right ) a^{2} b c}{2 f}-\frac {3 \ln \left (1+\tan ^{2}\left (f x +e \right )\right ) a \,b^{2} d}{2 f}-\frac {\ln \left (1+\tan ^{2}\left (f x +e \right )\right ) c \,b^{3}}{2 f}+\frac {\arctan \left (\tan \left (f x +e \right )\right ) a^{3} c}{f}-\frac {3 \arctan \left (\tan \left (f x +e \right )\right ) a^{2} b d}{f}-\frac {3 \arctan \left (\tan \left (f x +e \right )\right ) a \,b^{2} c}{f}+\frac {\arctan \left (\tan \left (f x +e \right )\right ) b^{3} d}{f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.90, size = 148, normalized size = 1.06 \[ \frac {2 \, b^{3} d \tan \left (f x + e\right )^{3} + 3 \, {\left (b^{3} c + 3 \, a b^{2} d\right )} \tan \left (f x + e\right )^{2} + 6 \, {\left ({\left (a^{3} - 3 \, a b^{2}\right )} c - {\left (3 \, a^{2} b - b^{3}\right )} d\right )} {\left (f x + e\right )} + 3 \, {\left ({\left (3 \, a^{2} b - b^{3}\right )} c + {\left (a^{3} - 3 \, a b^{2}\right )} d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right ) + 6 \, {\left (3 \, a b^{2} c + {\left (3 \, a^{2} b - b^{3}\right )} d\right )} \tan \left (f x + e\right )}{6 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 5.27, size = 141, normalized size = 1.01 \[ x\,\left (c\,a^3-3\,d\,a^2\,b-3\,c\,a\,b^2+d\,b^3\right )-\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (b^3\,d-3\,a\,b\,\left (a\,d+b\,c\right )\right )}{f}+\frac {{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (\frac {c\,b^3}{2}+\frac {3\,a\,d\,b^2}{2}\right )}{f}+\frac {\ln \left ({\mathrm {tan}\left (e+f\,x\right )}^2+1\right )\,\left (\frac {d\,a^3}{2}+\frac {3\,c\,a^2\,b}{2}-\frac {3\,d\,a\,b^2}{2}-\frac {c\,b^3}{2}\right )}{f}+\frac {b^3\,d\,{\mathrm {tan}\left (e+f\,x\right )}^3}{3\,f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.47, size = 240, normalized size = 1.71 \[ \begin {cases} a^{3} c x + \frac {a^{3} d \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {3 a^{2} b c \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} - 3 a^{2} b d x + \frac {3 a^{2} b d \tan {\left (e + f x \right )}}{f} - 3 a b^{2} c x + \frac {3 a b^{2} c \tan {\left (e + f x \right )}}{f} - \frac {3 a b^{2} d \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {3 a b^{2} d \tan ^{2}{\left (e + f x \right )}}{2 f} - \frac {b^{3} c \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {b^{3} c \tan ^{2}{\left (e + f x \right )}}{2 f} + b^{3} d x + \frac {b^{3} d \tan ^{3}{\left (e + f x \right )}}{3 f} - \frac {b^{3} d \tan {\left (e + f x \right )}}{f} & \text {for}\: f \neq 0 \\x \left (a + b \tan {\relax (e )}\right )^{3} \left (c + d \tan {\relax (e )}\right ) & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________